package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.entity.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author YYP
 * @date 2020/12/27
 */
public interface CategoryMapper extends BaseMapper<Category> {
    @Select("SELECT tc.* FROM `tb_category_brand` tcb \n" +
            "inner join tb_category tc\n" +
            "on tc.id = tcb.category_id\n" +
            "where tcb.brand_id=#{brandId}")
    List<Category> queryCategoryByBrandId(@Param("brandId") Long brandId);
}
